﻿<script src="~/Scripts/AdminControllers/_ChurchWorkerOrdinationController.js"></script>
<div class="col-md-12" ng-controller="ChurchWorkerOrdinationController">
    <div class="bg-white bs-0 mb-20 widget">
        <div class="custom-grid-header">
            <div class="custom-grid-name">
                Ordinations
            </div>
            <div class="custom-grid-menu">
                <ul class="custom-grid-menu-ul pull-right">
                    <li ng-show="mode==2" class="custom-grid-menu-ul-li" ng-click="mode=1">
                        <a  href="javascript:;" class="text-white"><i class="fa fa-close"></i></a>
                    </li>
                    <li class="custom-grid-menu-ul-li" ng-click="changeEditMode(mode)">
                        <a ng-show="mode==1" href="javascript:;" class="text-white"><i class="fa fa-pencil"></i></a>
                        <a ng-show="mode==2" href="javascript:;" class="text-white"><i class="fa fa-save"></i></a>
                    </li>
                </ul>
                <div class="clearfix"></div>
            </div>
            <div class="clearfix"></div>
        </div>
        <div class="widget-body" style="min-height: inherit">
            <div>
                <table class="table table-striped table-bordered">
                    <thead>
                    <th style="width: 30%">Designation Name</th>
                    <th style="width: 30%">Date Of Ordination</th>
                    <th style="width: 30%">Ordinated by</th>
                    <th style="width: 10%">Action&nbsp;</th>
                    </thead>
                    <tbody>
                        <tr ng-repeat="data in list">
                            <td>{{data.Designation.ChurchWorkerDesignationName}}</td>
                            <td>
                                <span ng-show="mode==1">{{data.DateOfOrdination}}</span>
                                <span ng-show="mode==2"><input type="text" class="form-control" ng-model="data.DateOfOrdination" maxlength="100" ng-minlength="3" calendar></span>
                            </td>
                            <td>
                                <span ng-show="mode==1">{{data.ChurchWorker.FullName}}</span>
                                <span ng-show="mode==2">
                                    <select ng-model="data.OrdinationedBy" class="form-control" ng-required="true" name="OrdinationedBy" ng-options="obj.ChurchWorkerId as obj.FullName for obj in Churchworkers"></select>
                                </span>
                            </td>
                            <td>
                                <div class="btn-group-sm" role="group" aria-label="Second group">
                                    <button type="button" class="btn btn-danger waves-effect" ng-click="delete(data.Designation.ChurchWorkerDesignationName,data.OrdinationId)"><i class="fa fa-trash"></i></button>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <div gridloader></div>
                <div nodata></div>
                <div class="clearfix"></div>
            </div>
        </div>
    </div>
</div>
